<!-- 海报管理 -->
<template>
  <el-container>
    <el-main>
      <el-card>
        <el-upload
          drag
          class="upload-demo"
          action="/api/upload"
          :on-change="changeFile"
        >
          <el-icon class="el-icon--upload"><upload-filled /></el-icon>

          <div class="el-upload__text">点击选择文件或将文件拖拽到此处</div>
        </el-upload>
      </el-card>
    </el-main>
  </el-container>
</template>

<script setup>
import { UploadFilled } from "@element-plus/icons-vue";
import { ElMessage } from "element-plus";

/**************************************************/

const changeFile = (file) => {
  if (file.response) {
    ElMessage.success("上传成功");
  }
};
</script>

<style lang="scss">
.el-upload {
  width: 100%;
  .el-upload-dragger {
    width: 100%;
  }
}
</style>
